package com.dmall.sort.test;

import java.util.*;

/**
 * @author xiao1.wang
 * @date 2021/10/7 10:10
 */
public class Application1 {

    public static void main(String[] args) {
        List<Integer> list = new ArrayList<Integer>(Arrays.asList(7, 5, 1, 8, 9, 4));
        System.out.println("排序前：" + list);
        Collections.sort(list);
        System.out.println("排序后：" + list);
    }

    public static int[] generateRandomArray(int start, int end, int size) {
        assert size > 0 && end >= start;
        int[] arr = new int[size];
        Random random = new Random();
        for (int i = 0; i < size; i++) {
            int randomNum = random.nextInt(end + start);
            int element = randomNum - start;
            arr[i] = element;
        }
        return arr;
    }
}
